new Vue({
    el: '#app',
    data () {
        return {
            dialogFormVisible: false,
            form: {
                name: '',
                password: '',
                date1: '',
                date2: '',
                delivery: false,
                type: [],
                resource: '',
                desc: ''
            },
            formLabelWidth: '120px',
            rules: {
                name: [
                    { required: true, message: '请输账号', trigger: 'blur' },
                    { min: 10, max: 11, message: '请检查账号正确性', trigger: 'blur' }
                ]
            }
        }
    },

    methods: {
        handleClose () {
            this.$refs.ruleForm.resetFields()
            this.form = {
                name: '',
                password: '',
                date1: '',
                date2: '',
                delivery: false,
                type: [],
                resource: '',
                desc: ''
            }
        },
        login() {
            axios.post('/student/login', this.user).then(res => {
                if (res.data) {
                    window.location.href = '/student/login_success';
                } else {
                    this.$message({
                        type: 'info',
                        message: '密码错误'
                    });
                }
            }).catch(function (error) { // 请求失败处理
                console.log(error);
            });
        },
    }

})